package xuruiqi20240318.two;

/**
 * @author 徐瑞琪
 */
public class Rectangle extends Pattern {
    //属性
    private double width;
    private double height;

    //操作接口
    public double getWeight() {
        return width;
    }

    public void setWeight(double weight) {
        this.width = weight;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    //计算面积
    public double countArea() {
        return this.width * this.height;
    }

    //构造方法
    //无参
    public Rectangle() {
        super.maps();
    }

    //有参
    public Rectangle(double weight, double height) {
        super.maps();
        this.width = weight;
        this.height = height;
    }
}
